<?php declare(strict_types=1);


namespace App\Model\Entity;

use Swoft\Db\Annotation\Mapping\Column;
use Swoft\Db\Annotation\Mapping\Entity;
use Swoft\Db\Annotation\Mapping\Id;
use Swoft\Db\Eloquent\Model;


/**
 * 话题表
 * Class Topics
 *
 * @since 2.0
 *
 * @Entity(table="topics", pool="db2.pool")
 */
class Topics extends Model
{
    /**
     * 
     * @Id()
     * @Column()
     *
     * @var int
     */
    private $id;

    /**
     * 话题
     *
     * @Column()
     *
     * @var string|null
     */
    private $title;

    /**
     * 排序
     *
     * @Column(name="sort_id", prop="sortId")
     *
     * @var int
     */
    private $sortId;

    /**
     * 0:删除 1:正常
     *
     * @Column()
     *
     * @var int
     */
    private $status;

    /**
     * 使用次数
     *
     * @Column(name="use_num", prop="useNum")
     *
     * @var int
     */
    private $useNum;

    /**
     * md5 hash值
     *
     * @Column()
     *
     * @var string
     */
    private $hash;

    /**
     * 在comment中被提及的次数
     *
     * @Column(name="comment_use_num", prop="commentUseNum")
     *
     * @var int
     */
    private $commentUseNum;

    /**
     * 是否作为默认推荐话题 1:是 0:否
     *
     * @Column(name="is_def", prop="isDef")
     *
     * @var int
     */
    private $isDef;


    /**
     * @param int $id
     *
     * @return void
     */
    public function setId(int $id): void
    {
        $this->id = $id;
    }

    /**
     * @param string|null $title
     *
     * @return void
     */
    public function setTitle(?string $title): void
    {
        $this->title = $title;
    }

    /**
     * @param int $sortId
     *
     * @return void
     */
    public function setSortId(int $sortId): void
    {
        $this->sortId = $sortId;
    }

    /**
     * @param int $status
     *
     * @return void
     */
    public function setStatus(int $status): void
    {
        $this->status = $status;
    }

    /**
     * @param int $useNum
     *
     * @return void
     */
    public function setUseNum(int $useNum): void
    {
        $this->useNum = $useNum;
    }

    /**
     * @param string $hash
     *
     * @return void
     */
    public function setHash(string $hash): void
    {
        $this->hash = $hash;
    }

    /**
     * @param int $commentUseNum
     *
     * @return void
     */
    public function setCommentUseNum(int $commentUseNum): void
    {
        $this->commentUseNum = $commentUseNum;
    }

    /**
     * @param int $isDef
     *
     * @return void
     */
    public function setIsDef(int $isDef): void
    {
        $this->isDef = $isDef;
    }

    /**
     * @return int
     */
    public function getId(): ?int
    {
        return $this->id;
    }

    /**
     * @return string|null
     */
    public function getTitle(): ?string
    {
        return $this->title;
    }

    /**
     * @return int
     */
    public function getSortId(): ?int
    {
        return $this->sortId;
    }

    /**
     * @return int
     */
    public function getStatus(): ?int
    {
        return $this->status;
    }

    /**
     * @return int
     */
    public function getUseNum(): ?int
    {
        return $this->useNum;
    }

    /**
     * @return string
     */
    public function getHash(): ?string
    {
        return $this->hash;
    }

    /**
     * @return int
     */
    public function getCommentUseNum(): ?int
    {
        return $this->commentUseNum;
    }

    /**
     * @return int
     */
    public function getIsDef(): ?int
    {
        return $this->isDef;
    }

}
